IF OBJECT_ID('ssf.ptx_get_task_dependency') IS NOT NULL
	DROP FUNCTION ssf.ptx_get_task_dependency
GO

CREATE FUNCTION ssf.ptx_get_task_dependency (
	@task_group_id INT
)
RETURNS TABLE
AS
/*
<object_header>

<object_summary>
	<purpose><![CDATA[

	]]></purpose>
</object_summary>

</object_header>
*/

	RETURN (
		SELECT d.task_dependency_id
			, d.task_id
			, d.depends_on_task_id
			, d.active_fl
			, d.insert_date
		FROM ssf.ptx_get_task(@task_group_id) t
		JOIN ssf.ptx_task_dependency d WITH (NOLOCK)
		ON t.task_id = d.task_id
	)
GO
